package com.huang.springboot.dao;

import com.huang.springboot.pojo.Department;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author yili_gi
 */
@Mapper
@Repository
public interface DepartmentMapper {

    /**
     * 获取所有部门信息
     * @return
     */
    List<Department> getDepartments();

    /**
     * 通过部门id获取部门
     * @param id
     * @return
     */
    Department getDepartmentById(@Param("id") int id);

    /**
     * 通过部门id获取部门名称
     * @param id
     * @return
     */
    String getDepartmentNameById(@Param("id") int id);

    /**
     * 添加部门
     * @param department
     * @return
     */
    int addDepartment(Department department);

    /**
     * 修改部门信息
     * @param department
     * @return
     */
    int updateDepartment(Department department);

    /**
     * 删除部门
     * @param departmentId
     * @return
     */
    int removeDepartment(int departmentId);
}
